<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>机构管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
	function page(n,s){
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
    	return false;
    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/office/view?id=${office.id}">机构查看</a></li>
	</ul><br/>
	
	
		<table class="table table-bordered  zdy">
			<tr>
				<th> 上级机构:</th>
				<td>${office.parent.name}</td>
				<th>归属区域:</th>
				<td> ${office.area.name}</td>
			</tr>
		<%--	<tr>
				<th>销售人:</th>
				<td> ${office.user.name}</td>
				<th>机构名称:</th>
				<td>${office.name}</td>
			</tr>--%>
			<tr>
				<th>渠道编号:</th>
				<td>${office.code}</td>
				<th> 机构类型:</th>
				<td>${office.officeType==1?'公司':'部门'}</td>
			</tr>
		
			<tr>
				<th>是否销售商:</th>
				<td>${office.isBusiness==1?'是':'否'}</td>
				<th>机构级别:</th>
				<td>${dic:getDictLabel(office.grade, 'sys_office_grade', '')}</td>
			</tr>
			<tr>
				<th>联系地址:</th>
				<td>${office.address}</td>
				<th>邮政编码:</th>
				<td>${office.zipCode}</td>
			</tr>
			<tr>
				<th>负责人:</th>
				<td>${office.master}</td>
				<th>电话:</th>
				<td>${office.phone}</td>
			</tr>
			<tr>
				<th>传真:</th>
				<td>${office.fax}</td>
				<th>邮箱:</th>
				<td>${office.email}</td>
			</tr>
			
<%--				<tr>
				<th>通路:</th>
				<td>${office.route.name}</td>
				<th>备注:</th>
				<td>${office.remarks}</td>
			
			</tr>--%>
		</table>
		
		<div style="font-size: 16px;font-family:'微软雅黑'">机构人员列表</div>
		<form:form id="searchForm" action="${ctx}/sys/office/view" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="orderBy" name="orderBy" type="hidden" value="${page.orderBy}"/>
		<input id="orderBy" name="id" type="hidden" value="${office.id}"/>
		<div style="margin-top:8px;">
			<label>登录名：</label><input name="loginName" htmlEscape="false" maxlength="50" class="input-medium"/>
			<label>姓&nbsp;&nbsp;&nbsp;名：</label><input name="name" htmlEscape="false" maxlength="50" class="input-medium"/>
			
		<%-- 	 <label>角色：</label>
			<select>
				<option value=''>请选择</option>
				<c:forEach items="${roleList}" var="role" varStatus="statOut">
				    <option value ="${role.id }">${role.name }</option>
				</c:forEach>
			</select> --%>
			
			&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
		</div>
	</form:form> 
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed table-responsive">
		<thead>
			<tr>
				
				<th class="sort loginName">登录名</th>
				<th class="sort name" width="88px">姓名</th>
				<th>电话</th>
				<th width="88px">手机</th>
				<th>用户状态</th>
				<th>用户角色</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="user">
			<tr>
				<td>${user.loginName}</td>
				<td>${user.name}</td>
				<td>${user.phone}</td>
				<td>${user.mobile}</td>
				<td>${dic:getDictLabel(user.userState, 'user_state', '')}</td>
				<td>
				<c:forEach items="${user.roleList}" var="role" varStatus="statOut">
				    ${role.name},
				</c:forEach>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
		
		
		<div class="form-actions">
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	
</body>
</html>